#pragma once

#include <Qt/qwidget.h>
#include <hge.h>
#include <hgesprite.h>
#include <qPoint>
class HGE;
class CPictureWidget : public QWidget
{
	Q_OBJECT

public:
	CPictureWidget(QWidget* parent = 0);
	~CPictureWidget();

	QPaintEngine* paintEngine() const;

	virtual void SetFileData( const char* pFileName );
	void SetZoom( float fHScale, float fVScale );
	void SelectedIt( hgeSprite* pSprite );
	void SelectOutIt();
protected:
	virtual void paintEvent(QPaintEvent *);
	virtual void mousePressEvent( QMouseEvent * event );
	virtual void mouseReleaseEvent( QMouseEvent * event );
	virtual void mouseMoveEvent( QMouseEvent * event );
	virtual void resizeEvent ( QResizeEvent * event );
signals:
	void sgMousePress( CPictureWidget* pWidget );

private:


	hgeSprite* m_pSprite;
	hgeSprite* m_pShow;
	QPoint		m_ptStart;
	QPoint		m_ptEnd;
	bool		m_bShowRect;
	float		m_fhScale;
	float		m_fvScale;

	float		m_fRenderX;
	float		m_fRenderY;
	bool		m_bRender;

};
